﻿@{
    Layout = null;
}
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>角色编辑、添加</title>
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/jqueryEasyui/js")
    @Styles.Render("~/jqueryEasyui/css")
    @Scripts.Render("~/Validform/js")
    @Styles.Render("~/Validform/css")

    <script type="text/javascript">


        $(function () {
            $(".registerform").Validform({
                tiptype: 2,
                postonce: true,
                ajaxPost: true,
                callback: function (data) {
                    if (data.status == "y") {
                        $.messager.alert("操作提示", data.info,"info", function () {
                            window.parent.$("#roleForm").dialog("close");
                        });
                    } else {
                        $.messager.alert(data.info);
                    }
                }
            });

            var editData = $.ifdata("editData");
            if (editData != null && editData != undefined) {
                $("#RoleName").val(editData.RoleName);
                $("#RoleName").attr("ajaxurl", "/adminweb/role/verifyName?id=" + editData.RoleID);
                $("#RoleIntro").val(editData.RoleIntro=="null" ? "无": editData.RoleIntro);
                $("#IsDisabled").val(editData.IsDisabled.toString());
                $("#RoleID").val(editData.RoleID);
            }
        });

    </script>

    <style type="text/css">
        tr
        {
            line-height:30px;
        }

    </style>
</head>
<body>
    <form id="form1"  @if (Model == "edit") { Write("action=/adminweb/role/editsave"); } else { Write("action=/adminweb/role/addSave"); } class="registerform">
    <div style="margin: 10px 0 0 10px; width: 480px;">
        <table>
            <tr>
                <td>
                    <span style="color: Red">*&nbsp;</span>角色名：
                </td>
                <td>
                    <input type="text" style="width:150px" id="RoleName" name="RoleName" class="inputxt" ajaxurl="/adminweb/role/verifyName?id="
                        datatype="*1-40" nullmsg="填写角色名。" errormsg="长度为1~40，请输入正确的字符串长度" />
                </td>
                <td>
                    <div class="Validform_checktip">
                        填写角色名。
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <span style="color: Red">&nbsp;&nbsp;</span>备&nbsp;&nbsp;&nbsp;注：
                </td>
                <td>
                    <textarea rows="6" id="RoleIntro" name="RoleIntro" style="width: 150px;"></textarea>
                </td>
                <td>
                    <div class="Validform_checktip">
                        角色的备注或者说明。
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <span style="color: Red">*&nbsp;</span>状&nbsp;&nbsp;&nbsp;态：
                </td>
                <td>
                    <select id="IsDisabled" name="IsDisabled">
                        <option value="true" selected="selected">开启</option>
                        <option value="false">禁用</option>
                    </select>
                </td>
                <td>
                    <div class="Validform_checktip">
                        是否启用
                    </div>
                </td>
            </tr>
        </table>
        <div class="aui_buttons" style="height: 35px; margin-top:20px; text-align:right;">
            <a href="#" class="easyui-linkbutton" style="margin-right:100px;" data-options="plain:true,iconCls:'icon-save'" onclick="$('form').submit()">保 存</a>
            <input type="hidden" id="RoleID" name="RoleID" value="" />
        </div>
    </div>
    </form>
</body>
</html>
